import Main from '@/components/main';
// import parentView from '@/components/parent-view';
// import Main from "@/components/main";

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  title: { String|Number|Function }
 *         显示在侧边栏、面包屑和标签栏的文字
 *         使用'{{ 多语言字段 }}'形式结合多语言使用，例子看多语言的路由配置;
 *         可以传入一个回调函数，参数是当前路由对象，例子看动态路由和带参路由
 *  hideInBread: (false) 设为true后此级路由将不会出现在面包屑中，示例看QQ群路由配置
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面在切换标签后不会缓存，如果需要缓存，无需设置这个字段，而且需要设置页面组件name属性和路由配置的name一致
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 *  beforeCloseName: (-) 设置该字段，则在关闭当前tab页时会去'@/router/before-close.js'里寻找该字段名对应的方法，作为关闭前的钩子函数
 *  hideTagNav:(false) 设为true后此级路由将不会出现在tagList中, (还有问题在修改)
 *  activeName: 设置当前路由高亮的菜单
 * }
 */

export default [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: 'Login - 登录',
      hideInMenu: true
    },
    component: () => import('@/view/login/login.vue')
  },
  {
    path: '/',
    name: '_home',
    redirect: '/project_gro/project_info',
    component: Main,
    meta: {
      hideInMenu: true,
      notCache: true,
      icon: 'md-home',
      title: '首页'
    }
  },
  // 项目管理
  {
    path: '/project_gro',
    name: 'project_gro',
    meta: {
      access: ['super_admin'],
      icon: 'iconfont icon-xiangmuguanli',
      showAlways: true,
      keepalive: true,
      title: '项目管理'
    },
    component: Main,
    children: [
      {
        path: 'project_info',
        name: 'project_info',
        meta: {
          keepalive: true,
          icon: 'iconfont icon-jibenxinxi',
          title: '基本信息'
        },
        component: () => import('@/view/manage-project/baseinfo/baseinfo.vue')
      },
      {
        path: 'staff',
        name: 'staff',
        meta: {
          keepalive: true,
          icon: 'iconfont icon-renyuanguanli',
          title: '人员管理'
        },
        component: () => import('@/view/manage-project/staff/staff.vue')
      },
      {
        path: 'project_gro_authority',
        name: 'project_gro_authority',
        meta: {
          keepalive: true,
          icon: 'iconfont icon-jiaosequanxianshezhi',
          title: '角色权限设置'
        },
        component: () => import('@/view/manage-project/roles/promission-set.vue')
      },
      {
        path: 'project_gro_customnum',
        name: 'project_gro_customnum',
        meta: {
          keepalive: true,
          icon: 'iconfont icon-zidingyibianhao',
          title: '自定义编号'
        },
        component: () => import('@/view/manage-project/custom-num/custom-num.vue')
      },
      {
        path: 'project_partition',
        name: 'project_partition',
        meta: {
          keepalive: true,
          icon: 'iconfont icon-xiangmuhuafen',
          title: '项目划分'
        },
        component: () =>
          import('@/view/manage-project/project-partition/new-tree.vue')
      },
      {
        path: 'menu_config',
        name: 'menu_config',
        meta: {
          keepalive: true,
          icon: 'iconfont icon-jianlipingdingguanli',
          title: '菜单管理'
        },
        component: () => import('@/view/manage-project/menu-config/menu-config.vue')
      },
      {
        path: 'design_value_config',
        name: 'design_value_config',
        meta: {
          keepalive: true,
          icon: 'iconfont icon-jianlipingdingguanli',
          title: '设计值配置'
        },
        component: () => import('@/view/manage-project/design-value-config/index.vue')
      },
      {
        path: 'design_value_config/edit',
        name: 'design_value_config_edit',
        meta: {
          keepalive: true,
          icon: 'iconfont icon-jianlipingdingguanli',
          title: '设计值配置 - 编辑'
        },
        component: () => import('@/view/manage-project/design-value-config/edit.vue')
      },
      {
        path: 'design_value_config/view',
        name: 'design_value_config_view',
        meta: {
          keepalive: true,
          icon: 'iconfont icon-jianlipingdingguanli',
          title: '设计值配置 - 详情'
        },
        component: () => import('@/view/manage-project/design-value-config/view.vue')
      },
      {
        path: 'project-partition/old-tree',
        name: 'project-partition_old-tree',

        meta: {
          keepalive: true,
          icon: 'iconfont icon-xiangmuhuafen',
          title: '项目划分',
          hideInMenu: true
        },
        component: () =>
          import('@/view/manage-project/project-partition/old-tree.vue')
      }, {
        path: 'project-partition/record-list',
        name: 'project-partition_record-list',
        meta: {
          icon: 'iconfont icon-xiangmuhuafen',
          hideInMenu: true,
          keepalive: true,
          title: '项目划分'
        },
        component: () =>
          import('@/view/manage-project/project-partition/record-list.vue')
      }
      // ,
      // {
      //   path: 'project_gro_6',
      //   name: 'project_gro_6',
      //   meta: {
      //     icon: 'ios-document-outline',
      //     title: '用表配置'
      //   },
      //   component: () =>
      //     import('@/view/multilevel/level-2-2/level-2-2-1.vue')
      // },
      // {
      //   path: 'project_gro_7',
      //   name: 'project_gro_7',
      //   meta: {
      //     icon: 'ios-cloud-download-outline',
      //     title: '导出/打印设置'
      //   },
      //   component: () =>
      //     import('@/view/multilevel/level-2-2/level-2-2-1.vue')
      // }
    ]
  },
  // 消息管理
  {
    path: '/msg_program',
    name: 'msg_program',
    meta: {
      access: ['super_admin'],
      icon: 'iconfont icon-xiaoxiguanli',
      showAlways: true,
      keepalive: true,
      title: '消息管理'
    },
    component: Main,
    children: [
      {
        path: 'msg_todo',
        name: 'msg_todo',
        meta: {
          keepalive: true,
          icon: 'iconfont icon-wodedaiban',
          title: '我的待办'
        },
        component: () =>
          import('@/view/manage-message/todo-list/todo-list.vue')
      },
      {
        path: 'msg_todo/detail',
        name: 'msg_todo_detail',
        meta: {
          icon: 'iconfont icon-wodedaiban',
          title: '我的待办 - 待办详情',
          hideInMenu: true,
          keepalive: true,
          activeName: 'msg_todo'
        },
        component: () =>
          import('@/view/manage-message/todo-list/todo-detail.vue')
      },
      {
        path: 'msg_done',
        name: 'msg_done',
        meta: {
          icon: 'iconfont icon-wodeyiban',
          keepalive: true,
          title: '我的已办'
        },
        component: () =>
          import('@/view/manage-message/done-list/done-list.vue')
      },
      {
        path: 'msg_done/detail',
        name: 'msg_done_detail',
        meta: {
          icon: 'iconfont icon-wodeyiban',
          title: '已办详情',
          hideInMenu: true,
          keepalive: true,
          activeName: 'msg_done'
        },
        component: () =>
          import('@/view/manage-message/done-list/done-detail.vue')
      },
      {
        path: 'msg_initiate',
        name: 'msg_initiate',
        meta: {
          keepalive: true,
          icon: 'iconfont icon-wodefaqi',
          title: '我的发起'
        },
        component: () =>
          import('@/view/manage-message/initiate-list/initiate-list.vue')
      },
      {
        path: 'msg_initiate/detail',
        name: 'msg_initiate_detail',
        meta: {
          icon: 'iconfont icon-wodefaqi',
          title: '发起详情',
          keepalive: true,
          hideInMenu: true,
          activeName: 'msg_initiate'
        },
        component: () =>
          import('@/view/manage-message/initiate-list/initiate-detail.vue')
      },
      {
        path: 'approval_process',
        name: 'approval_process',
        meta: {
          keepalive: true,
          icon: 'iconfont icon-morenshenpishezhi',
          title: '默认审批设置'
        },
        component: () =>
          import('@/view/manage-message/approval-process/approval-process.vue')
      },
      {
        path: 'approval_process/detail',
        name: 'approval_process_detail',
        meta: {
          title: '默认审批流程管理',
          keepalive: true,
          hideInMenu: true,
          activeName: 'approval_process'
        },
        component: () => import('@/view/manage-message/approval-process/process-detail.vue')
      }
    ]
  },
  // 检验管理
  {
    path: '/check_prg',
    name: 'check_prg',
    meta: {
      access: ['super_admin'],
      icon: 'iconfont icon-jianyanguanli',
      showAlways: true,
      title: '检验管理'
    },
    component: Main,
    children: [
      {
        path: 'construction_list',
        name: 'construction_list',
        meta: {
          keepalive: true,
          icon: ' iconfont icon-shigongzhijianbiao',
          title: '施工检验表'
        },
        component: () => import('@/view/manage-checkout/construction-list/construction-list.vue')
      },
      {
        path: 'construction_list/detail',
        name: 'construction_list_detail',
        meta: {
          keepalive: true,
          title: '施工检验表 - 检查表',
          hideInMenu: true,
          activeName: 'construction_list'
        },
        component: () => import('@/view/manage-checkout/construction-list/checkout-form-detail.vue')
      },
      {
        path: 'construction_list/view',
        name: 'construction_list_view',
        meta: {
          keepalive: true,
          title: '施工检验表 - 检查表',
          hideInMenu: true,
          activeName: 'construction_list'
        },
        component: () => import('@/view/manage-checkout/construction-list/checkout-form-view.vue')
      },
      {
        path: 'supervisor_list',
        name: 'supervisor_list',
        meta: {
          icon: ' iconfont icon-jianlizhijianbiao',
          keepalive: true,
          title: '监理质检表'
        },
        component: () => import('@/view/manage-checkout/supervisor-list/supervisor-list.vue')
      },
      {
        path: 'supervisor_list/detail',
        name: 'supervisor_list_detail',
        meta: {
          keepalive: true,
          title: '监理质检表 - 检查表',
          hideInMenu: true,
          activeName: 'supervisor_list'
        },
        component: () => import('@/view/manage-checkout/supervisor-list/supervisor-form-detail.vue')
      },
      {
        path: 'supervisor_list/view',
        name: 'supervisor_list_view',
        meta: {
          keepalive: true,
          title: '监理质检表 - 检查表',
          hideInMenu: true,
          activeName: 'supervisor_list'
        },
        component: () => import('@/view/manage-checkout/supervisor-list/supervisor-form-view.vue')
      }
    ]
  },
  // 评定管理
  {
    path: '/evaluate_prg',
    name: 'evaluate_prg',
    meta: {
      access: ['super_admin'],
      icon: ' iconfont icon-pingdingguanli',
      showAlways: true,
      title: '评定管理'
    },
    component: Main,
    children: [
      {
        path: 'evaluate_prg_1',
        name: 'evaluate_prg_1',
        meta: {
          icon: 'iconfont icon-shigongpingdingguanli',
          title: '施工评定管理'
        },
        component: () => import('@/view/manage-evaluate/construction-evaluate/construction-evaluate.vue')
      },
      {
        path: 'evaluate_prg_2',
        name: 'evaluate_prg_2',
        meta: {
          icon: 'iconfont icon-jianlipingdingguanli',
          title: '监理评定管理'
        },
        component: () => import('@/view/manage-evaluate/supervisor-ecaluate/supervisor-ecaluate.vue')
      }
    ]
  },
  // 工作台
  {
    path: '/plantform',
    name: 'plantform',
    meta: {
      access: ['super_admin'],
      hideInMenu: false,
      icon: ' iconfont icon-pingdingguanli',
      showAlways: true,
      title: '工作台'
    },
    component: () => import('@/view/plantform/workplantform.vue')
  },
  // {
  //   path: '/level_2_5',
  //   name: 'level_2_5',
  //   meta: {
  //     access: ['super_admin'],
  //     icon: 'md-copy',
  //     showAlways: true,
  //     title: '模板库'
  //   },
  //   component: Main,
  //   children: [
  //     {
  //       path: 'level_2_5_1',
  //       name: 'level_2_5_1',
  //       meta: {
  //         icon: ' iconfont icon-menu-report',
  //         title: '检验表模板'
  //       },
  //       component: () => import('@/view/update/update-table.vue')
  //     }
  //   ]
  // },
  {
    path: '/worktable',
    name: 'error_401',
    meta: {
      hideInMenu: false
    },
    component: () => import('@/view/error-page/401.vue')
  },
  // {
  //   path: '/401',
  //   name: 'error_401',
  //   meta: {
  //     hideInMenu: true
  //   },
  //   component: () => import('@/view/error-page/401.vue')
  // },
  {
    path: '*',
    name: 'error_404',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/404.vue')
  }
];
